<!-- 模块页面设置面板 -->
<template>
    <component v-if="componentTag" :is="componentTag" :element="element" />
</template>

<script>
import { defineComponent, toRefs, computed } from 'vue'
import { humpToLine } from '@/libs/tools'
import pageSetting from './components.js'
export default defineComponent({
    name: 'ModulePageSettingPane',
    components: {
        ...pageSetting
    },
    props: {
        type: {
            type: String,
            default: ''
        },
        element: {
            type: Object,
            default: () => ({})
        }
    },
    setup(props) {
        const { type, element } = toRefs(props)

        const componentTag = computed(() => pageSetting[humpToLine(type.value)])

        return {
            element,
            componentTag
        }
    }
})
</script>